package cn.shenxd.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.shenxd.config.DisableHystrixConfiguration;
import cn.shenxd.config.FullLoggerConfiguration;
import cn.shenxd.entity.User;

//@FeignClient(name="hello-service",configuration=DisableHystrixConfiguration.class) //指定服务名绑定hello-service服务,并禁用改实例的hystrix
@FeignClient(name="hello-service",fallback=HelloServiceFallback.class,configuration=FullLoggerConfiguration.class)
public interface HelloService {
	
	@RequestMapping("/hello")
	String hello();
	
	@GetMapping("/hello1")
	public String hello(@RequestParam("name") String name); //需指定@RequestParam，@RequestHeader参数名称
	
	@GetMapping("/hello2")
	public User hello(@RequestHeader("name") String name,@RequestHeader("age") Integer age);
	
	@PostMapping("/hello3")
	public String hello(@RequestBody User user);

}
